<?php
include "../templates/db/db.php";
$username = htmlspecialchars(trim($_POST['user']));

$sql_username = 'SELECT username FROM users WHERE username="'.$username.'"';
$results_username = mysql_query($sql_username);
$broi = mysql_num_rows($results_username);

if($broi != 0){
   echo "<p class='error'>Потребителското име е вече заето!</p>";
   $error=true;
}
?>